import request from "@/utils/request";

// 获取试题管理列表
export function getList(data) {
  return request({
    url: "/api/exam/question/getList",
    method: "post",
    data,
  });
}
// 获取试题管理
export function getInfo(id) {
  return request({
    url: `/api/exam/question/${id}`,
    method: "get",
  });
}
// 获取试题管理详情
export function getDetail(id) {
  return request({
    url: `/api/exam/question/detail/${id}`,
    method: "get",
  });
}
// 删除试题管理
export function Delete(id) {
  return request({
    url: `/api/exam/question/${id}`,
    method: "DELETE",
  });
}
// 批量删除试题管理
export function batchDelete(ids) {
  return request({
    url: `/api/exam/question/batchRemove/${ids}`,
    method: "DELETE",
  });
}
// 修改试题管理
export function Update(data) {
  return request({
    url: `/api/exam/question/${data.id}`,
    method: "PUT",
    data,
  });
}
// 新建试题管理
export function Create(data) {
  return request({
    url: "/api/exam/question",
    method: "post",
    data,
  });
}
// 批量新建试题管理
export function batchCreate(data) {
  return request({
    url: "/api/exam/question/batchCreate",
    method: "post",
    data,
  });
}

// 导入
export function ImportData(data, folderId, menuId) {
  return request({
    url: `/api/exam/question/importData/${folderId}/${menuId}`,
    method: "post",
    data,
  });
}
// 导入预览
export function ImportPreview(data) {
  return request({
    url: "/api/exam/question/importPreview",
    method: "get",
    data,
  });
}
// 模板下载
export function TemplateDownload() {
  return request({
    url: "/api/exam/question/templateDownload",
    method: "get",
  });
}
